using System;

namespace Update.Utils.Interfaces
{
    /// <summary>
    /// 系统帮助类接口
    /// </summary>
    public interface ISystemHelper
    {
        /// <summary>
        /// 判断是否以管理员权限运行
        /// </summary>
        /// <returns>是否以管理员权限运行</returns>
        bool IsRunAsAdministrator();

        /// <summary>
        /// 以管理员权限重启程序
        /// </summary>
        /// <param name="args">命令行参数</param>
        /// <returns>是否成功启动</returns>
        bool RestartAsAdministrator(string args = "");

        /// <summary>
        /// 获取应用程序版本
        /// </summary>
        /// <param name="filePath">文件路径</param>
        /// <returns>版本号</returns>
        string GetFileVersion(string filePath);

        /// <summary>
        /// 获取正在运行的进程列表
        /// </summary>
        /// <returns>进程名称列表</returns>
        string[] GetRunningProcesses();

        /// <summary>
        /// 通过进程名结束进程
        /// </summary>
        /// <param name="processName">进程名</param>
        /// <returns>是否成功</returns>
        bool KillProcessByName(string processName);

        /// <summary>
        /// 通过进程ID结束进程
        /// </summary>
        /// <param name="processId">进程ID</param>
        /// <returns>是否成功</returns>
        bool KillProcessById(int processId);

        /// <summary>
        /// 获取占用文件的进程ID
        /// </summary>
        /// <param name="filePath">文件路径</param>
        /// <returns>进程ID数组</returns>
        int[] GetProcessesLockingFile(string filePath);

        /// <summary>
        /// 获取系统信息
        /// </summary>
        /// <returns>系统信息字符串</returns>
        string GetSystemInfo();

        /// <summary>
        /// 创建开机启动项
        /// </summary>
        /// <param name="appName">应用名称</param>
        /// <param name="appPath">应用路径</param>
        /// <returns>是否成功</returns>
        bool CreateStartupItem(string appName, string appPath);

        /// <summary>
        /// 删除开机启动项
        /// </summary>
        /// <param name="appName">应用名称</param>
        /// <returns>是否成功</returns>
        bool RemoveStartupItem(string appName);

        /// <summary>
        /// 检查开机启动项是否存在
        /// </summary>
        /// <param name="appName">应用名称</param>
        /// <returns>是否存在</returns>
        bool IsStartupItemExists(string appName);
    }
} 